package com.qf.dto;

/*
 *  @author Administrator
 *  @version V1.0
 *  @Project banwoqiche
 *  @Package com.qf.dto
 *  @Description
 *  @Date2022/3/29 0029 19:37
 */

import com.qf.utils.ResultCode;

public class R {
    private Integer code;
    private String message;
    private Object data;

    public static R setOk() {
        return setOk(null);
    }

    public static R setOk(Object data) {
        return getR(ResultCode.SUCCESS, "success", data);
    }

    public static R setError(Integer code,String message,Object data) {
        return getR(ResultCode.FAIL, "fali", null);
    }


    public static R getR(Integer code,String message,Object data) {
        R r=new R();
        r.setCode(code);
        r.setMessage(message);
        r.setData(data);
        return r;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
